package com.example.foobar.dao.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.example.foobar.entity.ImsAccountWechats;
import com.example.foobar.mapper.ImsAccountWechatsMapper;
import com.example.foobar.dao.service.ImsAccountWechatsDaoService;
import com.example.foobar.param.ImsAccountWechatsPageParam;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import org.springframework.transaction.annotation.Transactional;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 *  服务实现类
 *
 * @author 郑英奔
 * @since 2021-05-31
 */
@Slf4j
@Service
@DS("db1")
public class ImsAccountWechatsDaoServiceImpl extends BaseServiceImpl<ImsAccountWechatsMapper, ImsAccountWechats> implements ImsAccountWechatsDaoService {

    @Autowired
    private ImsAccountWechatsMapper imsAccountWechatsMapper;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public boolean saveImsAccountWechats(ImsAccountWechats imsAccountWechats) throws Exception {
        return super.save(imsAccountWechats);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public boolean updateImsAccountWechats(ImsAccountWechats imsAccountWechats) throws Exception {
        return super.updateById(imsAccountWechats);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public boolean deleteImsAccountWechats(Long id) throws Exception {
        return super.removeById(id);
    }

    @Override
    public Paging<ImsAccountWechats> getImsAccountWechatsPageList(ImsAccountWechatsPageParam imsAccountWechatsPageParam) throws Exception {
        return null;
    }

    @Override
    public List<ImsAccountWechats> selectList(LambdaQueryWrapper<ImsAccountWechats> eq) {
        return imsAccountWechatsMapper.selectList(eq);
    }

}
